import { Injectable } from '@angular/core';

@Injectable({
  providedIn: 'root'
})
export class StorageService {

  constructor() { }

  set(key:string,value:any){
    localStorage.setItem(key,JSON.stringify(value));

  }


  get(key:string){
    // return 'this is a service';
    let result = localStorage.getItem(key)
    return result?JSON.parse(result):[];
  }
  remove(key:string){
    localStorage.removeItem(key);

  }
}
